<?php

flep_structure($structure, 'categoria');
$edit = false;

if(isset($_POST['id'])){
    $structure['where'][0] = sprintf("`%s`.`id`='%s'", $structure['table'], flep_decode($_POST['id']));
    $edit = flep_search_all($structure);
}

?><b><?php echo (!$edit?'Nueva ':'')?>Categoria</b>
  <br><br><br>
    <form class="save" action="store.php?type=horario" method="POST" id="form_horario" autocomplete="off">
        <input type="hidden" value="<?php echo ($edit?flep_encode($structure['data'][0]['id']):'')?>" id="id" name="id">
        <table>
            <tr>
                <td><label>Horario:</label></td>
                <td><input type="text" autofocus name="horario" style="width: 250px" value="<?php echo ($edit?$structure['data'][0]['horario']:'')?>" required placeholder="Horario"></td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" value="Guardar" style="margin-right: 100px;"><input type="reset" value="Limpiar"></td>
            </tr>
        </table>
    </form>
